package com.binarysoft.service.common.ping;

public class SendThread extends Thread{
	
	private PingServiceBean pingService;
	
	public SendThread(PingServiceBean pingService){
		super("Ping_SendThread");
		this.pingService = pingService;
	}
	
	
	
	public void run(){
		while (!this.pingService.isServiceClosed()) {
			PingTask pingTask = this.pingService.getPendingPingTask();
			if(pingTask != null){
				this.pingService.addProcessingPingTask(pingTask);
				this.pingService.sendEchoRequest(pingTask);
			}
		}
		this.pingService.countDown(); // 通知CPingService,本线程运行已经结束
	}

}
